package com.itheima.reggie.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.itheima.reggie.dto.DishDto;
import com.itheima.reggie.pojo.Dish_菜品;

import java.util.List;

/**
 * @Author: cl
 * @Date: 2022/4/3 - 04 - 03
 * @Description:
 */
public interface DishService extends IService<Dish_菜品> {

    //新增菜品，同时插入菜品对应的口味数据，需要操作两张表：dish、dish_flavor
    public void saveWithFlavor(DishDto dishDto);

    //根据id查询菜品和口味
    public DishDto getByIdWithFlavor(long id);

    //修改菜品并修改口味
    public void updateWithFlavor(DishDto dishDto);

    //批量修改
    void updateStatus(int status, long[] ids);

    //批量删除菜品和对应口味还有套餐中的菜品
    void removeByIdsWithFlavorAndSetmealDish(Long[] ids);



    //自定义多表查询分页查询
    public PageInfo<DishDto> search(String name, int page, int size);

}
